package com.quectel.emp.controller.device;


import com.quectel.core.module.device.dto.DeviceCategoryDto;
import com.quectel.core.module.device.service.DeviceCategoryService;
import com.quectel.emp.controller.BaseController;
import com.quectel.util.common.Response;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;

/**
 * @author caolu
 * @email louis.cao@quectel.com
 * @date 2019-05-31 12:10:19
 */
@RestController
@RequestMapping("deviceCategory")
@Tag(name = "DeviceCategoryController", description = "设备种类相关api")
public class DeviceCategoryController extends BaseController {

    @DubboReference
    private DeviceCategoryService deviceCategoryService;

    /**
     * 查询所有的种类
     */
    @GetMapping("queryAll")
    @Operation(summary = "查询所有的种类")
    public Response<List<DeviceCategoryDto>> queryAll() {
        List<DeviceCategoryDto> list = deviceCategoryService.queryList(new HashMap<>());
        return Response.<List<DeviceCategoryDto>>ok().wrap(list);
    }
}
